package com.khiker.binary;

public class P268_MissingNumber {
	public int missingNumber(int[] nums) {
		int n = nums.length;
		for(int i=0;i<nums.length;i++){
			n ^= nums[i]^i;
		}
		return n;
	}

	public static void main(String[] args) {
		P268_MissingNumber solution = new P268_MissingNumber();
		System.out.println(solution.missingNumber(new int[]{9, 6, 4, 2, 3, 5, 7, 0, 1}));
	}
}
